import ajax from '@/api/index'

export const Login = data => {
    return ajax({
        url: '/login',
        method: 'post',
        data

    })
};
// user列表
export const Users= params => {
    return ajax({
        url: '/users',
        method: 'get',
        params
        
    })
};
// 修改用户状态
// users/:uId/state/:type
export const State= (uId,type) => {
    return ajax({
        url: `users/${uId}/state/${type}`,
        method:'put',
        
    })
};

// 编辑用户提交
export const Edituser= (id,data) => {
    return ajax({
        url: `users/${id}`,
        method:'put',
        data
        
    })
};
// 添加用户
export const addUsers= data => {
    return ajax({
        url: 'users',
        method: 'post',
        data
        
    })
};

// 删除单个用户
export const Deleteuser= (id) => {
    return ajax({
        url: `users/${id}`,
        method:'delete',
       
        
    })
};

// 商品列表数据
export const Goods= (params) => {
    return ajax({
        url: 'goods',
        method: 'get',
        params
        
        
    })
};